package com.gimi.cloud.bbp.app.consumer.feign;

import java.util.Map;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.gimi.cloud.bbp.entity.user.User;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;

import feign.Headers;

/**
 * create by xiankejin on 2017-10-13
 */
@FeignClient(name = "bbp-app-service")
public interface UserFeignService {

    /**
     * 获取注册验证码
     * @param user
     * @return
     */
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @RequestMapping(value = "/user/getUserRegisterCode", method = RequestMethod.POST)
    String getUserRegisterCode(@RequestBody User user);

    /**
     * 提交申请表单获取回执信息  运营商
     * @param user
     * @return
     */
    @HystrixCommand(commandProperties = {@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "120000")})
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @RequestMapping(value = "user/applicationFormRetrieveInfo", method = RequestMethod.POST)
    String applicationFormRetrieveInfo(@RequestBody User user);

    /**
     * 采集运行商数据 提交短信验证码
     * @param paramMap
     * @return
     */
    @HystrixCommand(commandProperties = {@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "120000")})
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @RequestMapping(value = "user/getCarrierDataSubmitNoteCode", method = RequestMethod.POST)
    String getCarrierDataSubmitNoteCode(@RequestBody Map<String, Object> paramMap);

    /**
     * 获取初始化密码的验证码
     * @param user
     * @return
     */
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @RequestMapping(value = "/user/getInitpasswordPwdCode", method = RequestMethod.POST)
    String getInitpasswordPwdCode(User user);

    /**
     * 获取修改密码验证码
     * @param user
     * @return
     */
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @RequestMapping(value = "/user/getModifypasswordCode", method = RequestMethod.POST)
    String getModifypasswordCode(User user);
}